/*
 * @Description: 路由配置
 * @Author: zy
 * @Date: 2020-11-14 10:21:17
 * @LastEditors: zy
 * @LastEditTime: 2021-05-14 19:23:34
 */

import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/homepage/Home'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import Login from '@/components/homepage/Login'
import index from '@/components/homepage/Index'
import Detail from '@/components/homepage/Detail'
import Manage from '@/components/manage//Manage'
import Book from '@/components/manage/Book'
import User from '@/components/user/Outline'
import UserDetail from '@/components/user/Detail'

Vue.use(ElementUI)
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/index/home'
    },
    {
      path: '/user',
      component: User,
      children: [
        {
          path: 'userDetail',
          name: '',
          component: UserDetail
        }
      ]
    },
    {
      path: '/manage',
      component: Manage,
      children: [
        {
          path: 'book',
          name: '书籍管理',
          component: Book
        }
      ]
    },
    {
      path: '/index',
      component: index,
      children: [
        {
          path: 'login',
          component: Login
        },
        {
          path: 'home',
          component: Home
        },
        {
          path: 'detail',
          component: Detail
        }
      ]
    }
  ]
})
